package com.base.myproject.client.ui;


import com.base.myproject.client.busi.BaseStore;
import com.base.myproject.client.busi.BO.BaseObject;
import com.extjs.gxt.ui.client.event.BaseEvent;
import com.extjs.gxt.ui.client.event.ComponentEvent;
import com.extjs.gxt.ui.client.event.SelectionListener;
import com.extjs.gxt.ui.client.widget.Component;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.layout.BorderLayout;
import com.extjs.gxt.ui.client.widget.menu.MenuItem;

public class BasePanel extends LayoutContainer {
	MenuItem  menuitem= new MenuItem ();
	public BasePanel basepanel = null;
	String name="";
	 BaseStore<BaseObject> mainstore = null;
	 java.util.LinkedList<BaseStore<BaseObject>> basestorell = new java.util.LinkedList<BaseStore<BaseObject>>();
		
	 Component maincomponent = null;
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public BasePanel() {
		
		setLayout(new BorderLayout());
	
	//	this.init();
	
		basepanel = this;
	}
	protected void init()
	{
		throw new java.lang.RuntimeException("不能使用父类的init函数该函数必须被之类覆盖");
		/* 覆盖至少有
		 BorderLayoutData centerData = new BorderLayoutData(LayoutRegion.CENTER);  
		    centerData.setMargins(new Margins(5, 5, 0, 0));  
		this.add(initWeiget(),centerData);
		*/
	}
	public ContentPanel initWeiget()
	{
		return null;
	}
	public MenuItem setMenuAction()
	{
		 menuitem.addSelectionListener(new SelectionListener(){

				@Override
				public void componentSelected(ComponentEvent ce) {
					// TODO Auto-generated method stub
					
				}

				public void handleEvent(BaseEvent be) {
					// TODO Auto-generated method stub
				//	Info.display("MessageBox", "The '{0}' button was pressed","");  
					BaseTabPanel.getInstance().addTab("zgw3", basepanel);
					
					
				}});
		 return menuitem;
	}
	/**
	 * 获得主表，只能有唯一的主表
	 * @return the mainstore
	 */
	public BaseStore<BaseObject> getMainstore() {
		return mainstore;
	}
	/**
	 * @param mainstore the mainstore to set
	 */
	public void setMainstore(BaseStore<BaseObject> mainstore) {
		this.mainstore = mainstore;
	}
	


}
